import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo1 {
    public static void main(String[] args) {
        ExecutorService service= Executors.newFixedThreadPool(10);
        for (int i = 0; i < 1000; i++) {
            int n=i;
            service.submit(new Runnable() {

                @Override
                public void run() {
                    System.out.println("hello"+n);   //为啥不用i，因为i是伴随的主线程的，当主线程结束后
                                                    //i就销毁了，
                }
            });

        }
    }
}
